﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;


namespace picat
{
    class Program
    {
        static void Main (string [] args)
        {
            Bitmap  bitmap  = new Bitmap( Bitmap.FromFile (args[0]));
            int     width   = bitmap.Width;
            int     height  = bitmap.Height;

            Console.WriteLine ("{0} [{1}x{2}]", args[0], width, height);
            Console.WriteLine (bitmap.PixelFormat);
            Console.WriteLine (bitmap.Palette);
            Console.WriteLine ();

            for (int j = 0; j < height; ++j)
            {
                StringBuilder sb = new StringBuilder();

                for (int i = 0; i < width; ++i)    
                {
                    Color c = bitmap.GetPixel(i, j);

                    sb.Append (
                        ((c.R == 0) && (c.G == 0) && (c.B == 0)) ? ' ' : '#'
                    );
                }
                Console.WriteLine(sb.ToString());
            }

            bitmap.Dispose();
            Environment.Exit(0);
        }
    }
}
